/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package oplm;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author hh
 */
@Embeddable
public class CdkbnPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "MAIN_CD")
    private int mainCd;
    @Basic(optional = false)
    @Column(name = "SUB_CD")
    private int subCd;

    public CdkbnPK() {
    }

    public CdkbnPK(int mainCd, int subCd) {
        this.mainCd = mainCd;
        this.subCd = subCd;
    }

    public int getMainCd() {
        return mainCd;
    }

    public void setMainCd(int mainCd) {
        this.mainCd = mainCd;
    }

    public int getSubCd() {
        return subCd;
    }

    public void setSubCd(int subCd) {
        this.subCd = subCd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) mainCd;
        hash += (int) subCd;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CdkbnPK)) {
            return false;
        }
        CdkbnPK other = (CdkbnPK) object;
        if (this.mainCd != other.mainCd) {
            return false;
        }
        if (this.subCd != other.subCd) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "oplm.CdkbnPK[ mainCd=" + mainCd + ", subCd=" + subCd + " ]";
    }
    
}
